package com.shxy.dao.insurance;

import com.shxy.entity.insurance.InsuranceCase;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;

/**
 * 案件管理接口
 */
@Repository
public interface InsuranceCaseDao extends JpaRepository<InsuranceCase, Integer>, PagingAndSortingRepository<InsuranceCase, Integer> {


    /**
     * 查询指定客户所有案件列表
     * @param customerId
     * @return
     */
    Page<InsuranceCase> findAllByCustomerId(int customerId, Pageable pageable);

    /**
     * 查询指定客户某个时间段的案件列表
     * @param customerId
     * @param dateStart
     * @param dateEnd
     * @param pageable
     * @return
     */
    Page<InsuranceCase> findAllByCustomerIdAndReportDateBetween(int customerId, long dateStart, long dateEnd, Pageable pageable);

    /**
     * 查询所有客户指定时间段的案件列表
     * @param dateStart 起始时间
     * @param dateEnd 截至时间
     * @param pageable 分页信息
     * @return
     */
    Page<InsuranceCase> findAllByReportDateBetween(long dateStart, long dateEnd, Pageable pageable);

    /**
     * 查询所有客户所有案件列表
     * @return
     */
    Page<InsuranceCase> findAll(Pageable pageable);
}
